package com.clouddot.baipai.ui.util;

import com.clouddot.baipai.model.beam.getSchoolInfo.ArticleData;
import com.clouddot.baipai.model.beam.getSchoolInfo.BaseData;
import com.clouddot.baipai.model.beam.getSchoolInfo.FileData;
import com.clouddot.baipai.model.beam.getSchoolInfo.ThumbnailData;
import com.clouddot.baipai.model.beam.getSchoolInfo.getSchoolInfoResponse;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by wxy on 2018/4/15.
 */

public class AnalyzeRequestTypeUtil {
    public static List<Type> getSchoolInfo = new ArrayList<Type>() ;
    public static List<Type> getClassInfo = new ArrayList<Type>() ;

    public static List<Type> getSchoolInfoType(){
        if (getSchoolInfo.isEmpty()){
            getSchoolInfo.add(new TypeToken<BaseData>() {}.getType());
            getSchoolInfo.add(new TypeToken<ArticleData>() {}.getType());
            getSchoolInfo.add(new TypeToken<FileData>() {}.getType());
            getSchoolInfo.add(new TypeToken<ThumbnailData>() {}.getType());
            getSchoolInfo.add(new TypeToken<getSchoolInfoResponse.VideoData>() {}.getType());
        }
        return getSchoolInfo;
    }

    public static String[] getSchoolInfoName(){
        return new String[]{"BaseData", "ArticleData", "FileData", "ThumbnailData","VideoData"};
    }

    public static List<Type> getClassInfoType(){
        if (getClassInfo.isEmpty()){
            getClassInfo.add(new TypeToken<BaseData>() {}.getType());
            getClassInfo.add(new TypeToken<ArticleData>() {}.getType());
            getClassInfo.add(new TypeToken<FileData>() {}.getType());
            getClassInfo.add(new TypeToken<ThumbnailData>() {}.getType());
            getClassInfo.add(new TypeToken<getSchoolInfoResponse.VideoData>() {}.getType());
        }
        return getClassInfo;
    }
}
